package com.shipxpress;

import javax.servlet.http.HttpSession;

import com.shipxpress.register.model.UserList;
import com.shipxpress.register.view.UserListForm;

public class SessionManager {

    public static void setUserList(HttpSession session, UserList userList) {
        session.setAttribute("userList", userList);
    }

    public static UserList getSessionUserList(HttpSession session){
        UserList userList =  (UserList)session.getAttribute("userList");
        if (userList == null) {
            userList = new UserList();
        }
        return userList;
    }

    public static UserListForm getSessionUserListForm(HttpSession session) {
        return (UserListForm)session.getAttribute("userListForm");
    }

    public static void setUserListForm(HttpSession session, UserListForm listForm) {
        session.setAttribute("userListForm", listForm);
    }
}
